/*package com.kkwrite.regimen.consumer.controller.shop;

import static com.kkwrite.regimen.consumer.controller.constant.Constant.SERVICE_PREFIX;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestClientException;
import org.springframework.web.client.RestTemplate;

import com.kkwrite.regimen.common.constant.SortTypeEnum;
import com.kkwrite.regimen.common.entity.dto.OutDTO;
import com.kkwrite.regimen.consumer.controller.constant.Constant;

*//** 
 * 店铺模块
 *
 * @author Soosky Wang
 * @date 2018年7月21日 下午4:23:38 
 * @version 1.0.0
 *//*
@Api(value = "店铺模块")
@RestController
@RequestMapping("/shop")
public class ShopController {

	private static final Logger logger = LoggerFactory.getLogger(ShopController.class);
	
	@Resource(name = "restTemplate")
	private RestTemplate restTemplate;
	
	@ApiOperation(value = "根据店铺 id 查询店铺详情")
	@ApiImplicitParams(
        {
            @ApiImplicitParam(name = "shopId", value = "店铺 id", required = true, paramType = "path", dataType = "long")
        }
    )
	@SuppressWarnings("rawtypes")
	@GetMapping("/getshopdetail/{shopId}")
	public OutDTO getShopDetail(@PathVariable Long shopId) {
		if (logger.isDebugEnabled()) {
			logger.debug("ShopController.getShopDetail(), shopId = {}", shopId);
		}
		
		OutDTO outDTO;
		try {
			String url = Constant.SERVICE_PREFIX + "/shop/getshopdetail/" + shopId;
			outDTO = restTemplate.getForObject(url, OutDTO.class);
			return outDTO;
		} catch (RestClientException e) {
			logger.error("查询店铺详情出错，shopId = " + shopId + "_" + e.getMessage());
			e.printStackTrace();
			return new OutDTO("failed", e.getMessage());
		}
	}
	
	@ApiOperation(value = "店铺项目列表分页接口")
	@ApiImplicitParams({
			@ApiImplicitParam(name = "page", value = "获取第page页数据", required = true, allowableValues = "[0, infinity]", paramType = "query", dataType = "Long"),
			@ApiImplicitParam(name = "size", value = "每页size条记录", required = true, allowableValues = "[1, infinity]", paramType = "query", dataType = "int"),
			@ApiImplicitParam(name = "shopId", value = "店铺 id", required = true, paramType = "path", dataType = "Long"),
			@ApiImplicitParam(name = "sortType", value = "按时间排序的排序类型", defaultValue = "2", allowableValues = "{1, 2}", paramType = "path", dataType = "int") })
	@GetMapping("/getItem")
	public OutDTO getItem(@RequestParam(required = false) Integer page,
			@RequestParam(required = false) Integer size,
			@RequestParam Long shopId,
			@PathVariable(required = false) Integer sortType,
			HttpServletRequest request) {
		if (shopId == null || shopId.equals("")) {
			return new OutDTO<>("false", "002", "token invalid");
		}
		if (page == null || page < 0 || size == null || size < 1) {
			return new OutDTO<>("false", "入参不合法");
		}
		if (!SortTypeEnum.isSortType(sortType)) {
			sortType = 2;
		}
		return restTemplate.getForObject(SERVICE_PREFIX
				+ "/shop/getItem?page=" + page + "&size=" + size
				+ "&shopId=" + shopId + "&sortType=" + sortType, OutDTO.class);
	}
}
*/